from pytadbit.imp.impmodel import load_impmodel_from_cmm, load_impmodel_from_xyz
model = load_impmodel_from_cmm('./model.3261.cmm')
print model.center_of_mass()
print model.radius_of_gyration()
{'y': -11976.696977752474, 'x': 1459.4080388960351, 'z': -5505.949389580002}
2107.38031986
Radius of gyration (or gyradius) can also be seen with chimera:
model.view_model(tool='chimera_nogui', savefig='/tmp/image_model_2.png',centroid=True, gyradius=True)
model.view_model(tool='chimera_nogui', centroid=True, gyradius=True, savefig='/tmp/image_model_2.webm')
print model.contour()
100002.254636
The length of the chromatin strand modelled is thus 100002 nm long.
Find the longest and shortest distance between 2 particles:
print model.longest_axe()
print model.shortest_axe()
7033.67649175
374.538753758
Characterize a cube that includes the model:
print model.cube_side()
print model.cube_volume()
8861.41178682
6.95838983082e+11
In order to infer which part of the modeled chromatin can be accessed by an object, like the transcription machinery, TADBit calculates a mesh around the model, and checks for each point of this mesh if an object of a given size can fit.
Here an example revealing the surface of a chromatin strand accessible to a hypothtical protein of 400 nanometers (radius of 200 nanometers):
acc_dots, tot_dots, acc_area, tot_area, acc_vs_inacc = model.accessible_surface(200, nump=100, verbose=True,
write_cmm_file='./model_mesh.cmm',
savefig='/tmp/model_mesh.webm',
chimera_bin='chimera_nogui')
Accessible surface: 90.34 micrometers^2(17972 accessible times 0.00502654824574 micrometers)
(17972 accessible dots of 22080 total times 0.00503 micrometers)
- 81.39% of the contour mesh
- 71.6% of a virtual straight chromatin (126.17 microm^2)
The function bellows gives an important amount of information.
acc_dots, tot_dots, acc_area, tot_area, acc_vs_inacc = model.accessible_surface(200, nump=100, verbose=True,
include_edges=False,
write_cmm_file='./model_partmesh.cmm',
savefig='/tmp/model_partmesh.webm',
chimera_bin='chimera_nogui')
Accessible surface: 19.46 micrometers^2(3872 accessible times 0.00502654824574 micrometers)
(3872 accessible dots of 4125 total times 0.00503 micrometers)
- 93.87% of the contour mesh
- 15.43% of a virtual straight chromatin (126.17 microm^2)